#ifndef MUTEX_H
#define MUTEX_H
#include <pthread.h>
#include <exception>

namespace concurrent {

class Mutex : private common::Uncopyable
{
public:
	Mutex();
	~Mutex();

	bool trylock();
	bool lock();
	bool unlock();
	bool destroy(); 

private:
	pthread_mutex_t _mutex;
};

class MutexException : public std::exception
{
public:
	virtual const char *what() const throw() {
		return "Could not initialize Mutex";
	}
};

}

#endif /* MUTEX_H */

